.class public Lcom/instagram/ui/widget/spinner/RefreshSpinner;
.super Landroid/widget/ImageView;
.source "RefreshSpinner.java"


# instance fields
.field private a:Landroid/view/animation/Animation;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    .line 20
    invoke-direct {p0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 21
    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->a(Landroid/util/AttributeSet;)V

    .line 22
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 25
    invoke-direct {p0, p1, p2}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 26
    invoke-direct {p0, p2}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->a(Landroid/util/AttributeSet;)V

    .line 27
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    .line 30
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 31
    invoke-direct {p0, p2}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->a(Landroid/util/AttributeSet;)V

    .line 32
    return-void
.end method

.method private a(Landroid/util/AttributeSet;)V
    .locals 4
    .parameter

    .prologue
    .line 42
    sget v0, Lcom/facebook/av;->action_bar_glyph_refresh_spinner:I

    .line 44
    if-eqz p1, :cond_1

    .line 45
    invoke-virtual {p0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->getContext()Landroid/content/Context;

    move-result-object v1

    sget-object v2, Lcom/facebook/bc;->RefreshSpinner:[I

    invoke-virtual {v1, p1, v2}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;

    move-result-object v1

    .line 48
    sget v2, Lcom/facebook/bc;->RefreshSpinner_dark:I

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 49
    sget v0, Lcom/facebook/av;->action_bar_glyph_refresh_spinner_dark:I

    .line 52
    :cond_0
    invoke-virtual {v1}, Landroid/content/res/TypedArray;->recycle()V

    .line 55
    :cond_1
    invoke-virtual {p0, v0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->setImageResource(I)V

    .line 56
    invoke-virtual {p0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->getContext()Landroid/content/Context;

    move-result-object v0

    sget v1, Lcom/facebook/ar;->rotate_spinner:I

    invoke-static {v0, v1}, Landroid/view/animation/AnimationUtils;->loadAnimation(Landroid/content/Context;I)Landroid/view/animation/Animation;

    move-result-object v0

    iput-object v0, p0, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->a:Landroid/view/animation/Animation;

    .line 57
    return-void
.end method


# virtual methods
.method protected onAttachedToWindow()V
    .locals 1

    .prologue
    .line 61
    invoke-super {p0}, Landroid/widget/ImageView;->onAttachedToWindow()V

    .line 63
    invoke-virtual {p0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->getVisibility()I

    move-result v0

    if-nez v0, :cond_0

    .line 64
    iget-object v0, p0, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->a:Landroid/view/animation/Animation;

    invoke-virtual {p0, v0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->startAnimation(Landroid/view/animation/Animation;)V

    .line 66
    :cond_0
    return-void
.end method

.method protected onDetachedFromWindow()V
    .locals 0

    .prologue
    .line 85
    invoke-virtual {p0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->clearAnimation()V

    .line 86
    invoke-super {p0}, Landroid/widget/ImageView;->onDetachedFromWindow()V

    .line 87
    return-void
.end method

.method protected onVisibilityChanged(Landroid/view/View;I)V
    .locals 1
    .parameter "changedView"
    .parameter "visibility"

    .prologue
    .line 70
    invoke-super {p0, p1, p2}, Landroid/widget/ImageView;->onVisibilityChanged(Landroid/view/View;I)V

    .line 72
    if-ne p1, p0, :cond_0

    invoke-virtual {p0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->getWindowToken()Landroid/os/IBinder;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 73
    if-nez p2, :cond_1

    .line 74
    invoke-virtual {p0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->getAnimation()Landroid/view/animation/Animation;

    move-result-object v0

    if-nez v0, :cond_0

    .line 75
    iget-object v0, p0, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->a:Landroid/view/animation/Animation;

    invoke-virtual {p0, v0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->startAnimation(Landroid/view/animation/Animation;)V

    .line 81
    :cond_0
    :goto_0
    return-void

    .line 78
    :cond_1
    invoke-virtual {p0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->clearAnimation()V

    goto :goto_0
.end method

.method public setDark(Z)V
    .locals 1
    .parameter "dark"

    .prologue
    .line 35
    if-eqz p1, :cond_0

    sget v0, Lcom/facebook/av;->action_bar_glyph_refresh_spinner_dark:I

    :goto_0
    invoke-virtual {p0, v0}, Lcom/instagram/ui/widget/spinner/RefreshSpinner;->setImageResource(I)V

    .line 39
    return-void

    .line 35
    :cond_0
    sget v0, Lcom/facebook/av;->action_bar_glyph_refresh_spinner:I

    goto :goto_0
.end method
